"use strict";

var gulp = require("gulp");
var path = require("path");
var source = path.join(__dirname, "..", "tasks", "md", "*.md");
var build = path.join(__dirname, "..", "doc", "tasks");
var generated = path.join(__dirname, "..", "autodoc");

/**
 * Generate documentation for tasks.
 * Will parse ``tasks/task.md`` into html.
 *
 * @method taskDoc
 */
function taskDoc() {
  var plugins = this.opts.plugins;
  return gulp.src(source)
    .pipe(plugins.markdownDoc("index.html", {
      yamlMeta: true
    }))
    .pipe(gulp.dest(build));
}

module.exports = taskDoc;
